#include "Utils.h"

#include <stdio.h>

const char* Utils::GetTime(void)
{
  time_t rawtime;
  struct tm* timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  
  const char wday_name[][3] = {"Pn", "Wt", "Sr", "Cz", "Pt", "So", "Ni"};
  const char mon_name[][4] = {"Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paz", "Lis", "Gru"};
  
  static char result[26];
  sprintf(result, "%.2s, %d %.3s %d, %.2d:%.2d:%.2d",
						  wday_name[timeinfo->tm_wday],
						  timeinfo->tm_mday,
						  mon_name[timeinfo->tm_mon],
						  1900+timeinfo->tm_year,
						  timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);

  return result;
}
